{temp('admin/head')}
<link rel="stylesheet" href="{$adstyle}/js/datatables/dataTables.bootstrap.css">
<script src="{$adstyle}/js/art/artDialog.source.js?skin=opera"></script>
<script src="{$adstyle}/js/art/plugins/iframeTools.source.js"></script>

</head>

<body class="page-body">	
		{temp('admin/left')}
			{temp('admin/top')}			
			<!-- Basic Setup -->
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">{$tit}</h3>
					<div class="panel-options">
						<a href="{$_url}/admin/?act=tempgl{$gnpd}">
							<i class="fa-rotate-right"></i>
							刷新
						</a>
					</div>
				</div>
				
				<div class="panel-body">
					<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$("#example-1").dataTable({
							"oLanguage": {
								"sUrl":"{$adstyle}/js/datatables/js/zn.txt"
							},
							aLengthMenu: [
								[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]
							]
						});
					});
					</script>
					
					 <div class="row">
					{if(@$rs)}
						{foreach($rs as $k=>$v)}
						<div class="col-sm-3" >
							<a href="{$_url}/admin/?act=tempgl&met=temp_list&id={$v['id']}{$gnpd}">
							{if(@$v['lst'])}
							<img src="{$v['sy_src']}" width="150px" height="150px"  title="点击进入下一级" style="cursor:pointer;border:1px;"/>
							{else}
							<img src="{$adstyle}/images/zw.png" width="150px" height="150px"  title="点击进入下一级" style="cursor:pointer;border:1px;"/>
							{/if}
							</a>
							<p style="margin-top:5px;">
							<span class="btn btn-secondary btn-icon icon-left" >
								{$v['temp']}
							</span>
							{if($_mb == $v['temp'])}
							<span><a  href="{$_url}/admin/?act=tempgl&met=book&pa={$v['id']}{$gnpd}" target="_blank" class="btn btn-secondary btn-icon icon-left" >
								预览
							</a></span>
							{/if}
							{if($_mb != $v['temp'])}
							<span onclick="qhmb({$v['id']})" class="btn btn-info btn-icon icon-left">
								设置为默认模板
							</span>
							{else}
							<span class="btn btn-danger  btn-icon icon-left">
								当前默认模板
							</span>
							{/if}
							</p>
						</div>
						{/foreach}
					{else}
						暂无模板
					{/if}
					</div> 
				</div>
			</div>
		{temp('admin/foot')}
		<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>
	<script src="{$adstyle}/js/datatables/js/jquery.dataTables.min.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/datatables/dataTables.bootstrap.js"></script>
	<script src="{$adstyle}/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
	<script src="{$adstyle}/js/datatables/tabletools/dataTables.tableTools.min.js"></script>
	
	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script> 
		
	<script>
	function qhmb(id){
		$.post('{$_url}/admin/?act=tempgl&met=qhmb{$gnpd}',{id:id},function(data){ 	
			if(data == 'cg'){
				alert('设置成功，请刷新预览');
				location.href = '';
			}else{
				alert(data);
			} 
		});
	}
	</script>

</body>
</html>